package com.example.leetcode.bfs;

import com.example.leetcode.bfs.common.BFSUtils;
import com.example.leetcode.tree.common.TreeNode;
import com.example.leetcode.tree.common.TreeUtils;

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 * int val;
 * TreeNode left;
 * TreeNode right;
 * TreeNode() {}
 * TreeNode(int val) { this.val = val; }
 * TreeNode(int val, TreeNode left, TreeNode right) {
 * this.val = val;
 * this.left = left;
 * this.right = right;
 * }
 * }
 */
class Solution2471 {
    public int minimumOperations(TreeNode root) {
        return BFSUtils.minimumOperations(root);
    }
}

public class leetcode2471 {
    public static void main(String[] args) {
        Solution2471 solution2471 = new Solution2471();
        Integer[] nums = {1, 4, 3, 7, 6, 8, 5, null, null, null, null, 9, null, 10};
        Integer[] nums1 = {1, 7, 6, 8, 5, 9, 10, null, 2, null, 0, null, 1, 4, 3};
        System.out.println(solution2471.minimumOperations(TreeUtils.generateLeetcodeTree(nums)));
        System.out.println(solution2471.minimumOperations(TreeUtils.generateLeetcodeTree(nums1)));
    }
}
